
#include "Analyser.h"

#ifdef WIN32
#include <io.h>
#else
#include <fcntl.h>
#include <sys/types.h>
#include <unistd.h>
#endif

using namespace std;

int main(int argc, char* const argv[])
{
	// Anzahl der Programmparameter �berpr�fen
	/*if (argc != 2)
	{
		cout << "Wrong parameters" << endl;
		cin.get();
		return 0;
	}*/
		
	Parser* p = new Parser();

	try {
		p->setFile(argv[1]);
		p->parse();
	}
	catch (ParserSemanticException e) {
		cout << e.getMessage() << std::endl;
	}
	catch(ParserException e) {
		cout << e.getMessage() << std::endl;
	}
	catch (ValueException e) {
		cout << e.getMessage() << endl;
	}
	catch (InterpreterException e) {
		cout << e.getMessage() << endl;
	}	
	catch(ScannerFSMException e) {
		cout << e.getMessage() << std::endl;
	}	
	catch(BufferException e) {
		cout << e.getMessage() << std::endl;
	}

	std::cin.get();

	return 0;
}